; Music of Munsters (1989) (Tiger Developments) (Ben Daglish)
; Ripped by Megachur the 22/04/2007

	write "MUNSTERS.BIN"

music_date_rip	equ &1647
music_adr	equ &3788
first_theme	equ 0
last_theme	equ 0

	read "music_header_v1_0.asm"

.l3788
	dw #0777,#070c,#06a7,#0647
	dw #05ed,#0598,#0547,#04fc
	dw #04d4,#0470,#0431,#03f4
	dw #03dc,#0386,#0353,#0324
	dw #02f6,#02cc,#02a4,#027e
	dw #025a,#0238,#0218,#01fa
	dw #01de,#01c3,#01aa,#0192
	dw #017b,#0166,#0152,#013f
	dw #012d,#011c,#010c,#00fd
	dw #00ef,#00e1,#00d5,#00c9
	dw #00be,#00b3,#00a9,#009f
	dw #0096,#008e,#0086,#007f
	dw #0077,#0071,#006a,#0064
	dw #005f,#0059,#0054,#0050
	dw #004b,#0047,#0043,#003f
	dw #003c,#0038,#0035,#0032
	dw #002f,#002d,#002a,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001c,#001a,#0019
	dw #0017,#0016,#0015,#0014
	dw #0013,#0012,#0011,#0010
.l3832 equ $ + 2
	db #0c,#00,#80,#12,#14,#81,#1e,#0a
	db #1e,#0a,#80,#19,#0a,#1a,#0a,#81
.l3845 equ $ + 5
	db #1e,#0a,#1e,#0a,#ff,#82,#0b,#28
.l384d equ $ + 5
	db #11,#0a,#12,#1e,#ff,#82,#17,#14
	db #1a,#0a,#17,#0a,#1d,#0a,#1e,#1e
.l3859 equ $ + 1
	db #ff,#80,#0b,#14,#81,#1e,#0a,#1e
	db #0a,#80,#0b,#14,#81,#1e,#0a,#1e
	db #0a,#80,#04,#14,#81,#1e,#0a,#1e
	db #0a,#80,#04,#14,#81,#1e,#0a,#1e
	db #0a,#80,#12,#14,#81,#1e,#0a,#1e
	db #0a,#80,#06,#14,#81,#1e,#0a,#1e
.l388a equ $ + 2
	db #0a,#ff,#83,#17,#0a,#17,#0a,#1a
	db #0a,#1a,#0a,#1e,#0a,#1e,#0a,#1a
	db #0a,#1a,#0a,#1c,#0a,#1c,#0a,#1f
	db #0a,#1f,#0a,#23,#0a,#23,#0a,#1f
	db #0a,#1f,#0a,#17,#0a,#17,#0a,#1a
	db #0a,#1a,#0a,#15,#0a,#15,#0a,#19
.l38bc equ $ + 4
	db #0a,#19,#0a,#ff,#83,#17,#0a,#17
	db #0a,#1a,#0a,#1a,#0a,#1e,#0a,#1e
	db #0a,#1a,#0a,#1a,#0a,#1c,#0a,#1c
	db #0a,#1f,#0a,#1f,#0a,#23,#0a,#23
	db #0a,#1f,#0a,#1f,#0a,#1e,#0a,#1e
	db #0a,#22,#0a,#22,#0a,#1e,#0a,#1c
.l38ee equ $ + 6
	db #0a,#1a,#0a,#19,#0a,#ff,#82,#0b
	db #28,#11,#0a,#12,#0a,#09,#14,#ff
.l38f8
	db #83,#23,#14,#26,#0a,#23,#0a,#29
	db #0a,#2a,#0a,#2f,#14,#2b,#0a,#2a
	db #0a,#28,#28,#2a,#0a,#28,#0a,#26
	db #14,#28,#0a,#26,#0a,#25,#0a,#23
.l391c equ $ + 4
	db #0a,#21,#14,#ff,#83,#23,#14,#26
	db #0a,#23,#0a,#29,#0a,#2a,#0a,#2f
	db #14,#2b,#0a,#2a,#0a,#28,#28,#26
	db #0a,#28,#0a,#2a,#14,#1e,#0a,#1e
	db #0a,#1e,#0a,#20,#0a,#22,#14,#ff
.l3940
	db #82,#17,#14,#1a,#0a,#17,#0a,#1d
.l394e equ $ + 6
	db #0a,#1e,#0a,#15,#14,#ff,#80,#09
	db #14,#81,#1e,#0a,#1e,#0a,#80,#0d
	db #14,#81,#1e,#0a,#1e,#0a,#80,#0e
	db #14,#81,#1e,#0a,#1e,#0a,#80,#02
	db #14,#81,#1e,#0a,#1e,#0a,#80,#04
	db #14,#81,#1e,#0a,#1e,#0a,#80,#04
	db #14,#81,#1e,#0a,#1e,#0a,#80,#09
	db #14,#81,#1e,#0a,#1e,#0a,#80,#06
.l398f equ $ + 7
	db #14,#81,#1e,#0a,#1e,#0a,#ff,#82
	db #25,#14,#25,#14,#28,#28,#21,#14
	db #21,#14,#1e,#28,#20,#14,#20,#14
	db #20,#28,#21,#0a,#23,#0a,#1f,#0a
.l39ad equ $ + 5
	db #21,#0a,#1e,#28,#ff,#82,#2a,#02
	db #2b,#02,#2c,#02,#2d,#0e,#2d,#14
	db #2d,#14,#2b,#14,#2a,#0a,#2b,#0a
	db #28,#0a,#2a,#0a,#26,#14,#83,#32
	db #08,#31,#02,#30,#02,#2e,#02,#2d
	db #02,#2c,#02,#2b,#02,#82,#28,#14
	db #28,#14,#34,#1e,#32,#0a,#31,#0a
	db #32,#0a,#2f,#0a,#31,#0a,#2e,#28
.l39e9 equ $ + 1
	db #ff,#80,#0b,#14,#81,#1e,#0a,#1e
	db #0a,#80,#0b,#14,#81,#1e,#0a,#1e
	db #0a,#80,#04,#14,#81,#1e,#0a,#1e
	db #0a,#80,#04,#14,#81,#1e,#0a,#1e
	db #0a,#80,#0b,#14,#81,#1e,#0a,#1e
	db #0a,#80,#11,#0a,#12,#0a,#81,#1e
	db #0a,#1e,#0a,#80,#0b,#14,#81,#1e
	db #0a,#1e,#0a,#80,#11,#0a,#12,#0a
.l3a2e equ $ + 6
	db #81,#1e,#0a,#1e,#0a,#ff,#83,#17
	db #0a,#17,#0a,#1a,#0a,#1a,#0a,#1e
	db #0a,#1e,#0a,#1a,#0a,#1a,#0a,#1c
	db #0a,#1c,#0a,#1f,#0a,#1f,#0a,#23
	db #0a,#23,#0a,#1f,#0a,#1f,#0a,#17
	db #0a,#17,#0a,#1a,#0a,#1a,#0a,#1d
	db #0a,#1e,#0a,#12,#0a,#12,#0a,#17
	db #0a,#17,#0a,#1a,#0a,#1a,#0a,#1d
	db #0a,#1e,#0a,#12,#0a,#12,#0a,#ff
.l3a70
	db #82,#21,#14,#21,#14,#24,#05,#23
	db #05,#21,#0a,#1d,#0a,#1e,#0a,#1a
	db #0a,#15,#0a,#1a,#0a,#1e,#0a,#21
	db #28,#20,#14,#20,#14,#20,#28,#21
	db #0a,#23,#0a,#1f,#0a,#21,#0a,#1e
.l3a9a equ $ + 2
	db #28,#ff,#83,#23,#14,#26,#0a,#23
	db #0a,#29,#0a,#2a,#0a,#2f,#14,#2b
	db #0a,#2a,#0a,#28,#28,#2a,#0f,#28
	db #05,#26,#14,#23,#28,#2a,#0f,#28
	db #05,#26,#14,#23,#28,#21,#14,#ff
.l3ac0
	db #82,#2a,#02,#2b,#02,#2c,#02,#2d
	db #0e,#2d,#14,#30,#05,#2f,#05,#2d
	db #0a,#29,#0a,#2a,#0a,#26,#0a,#21
	db #0a,#26,#0a,#2a,#0a,#26,#14,#83
	db #32,#08,#31,#02,#30,#02,#2e,#02
	db #2d,#02,#2c,#02,#2b,#02,#82,#28
	db #14,#28,#14,#34,#1e,#32,#0a,#31
	db #0a,#32,#0a,#2f,#0a,#31,#0a,#2e
.l3b02 equ $ + 2
	db #28,#ff,#83,#91,#23,#0a,#23,#0a
	db #23,#0a,#23,#0a,#23,#0a,#23,#0a
	db #23,#0a,#23,#0a,#92,#23,#0a,#23
	db #0a,#23,#0a,#23,#0a,#23,#0a,#23
	db #0a,#23,#0a,#23,#0a,#91,#23,#0a
	db #23,#0a,#23,#0a,#23,#0a,#93,#21
	db #0a,#21,#0a,#21,#0a,#21,#0a,#90
.l3b39 equ $ + 1
	db #ff,#83,#91,#23,#0a,#23,#0a,#23
	db #0a,#23,#0a,#23,#0a,#23,#0a,#23
	db #0a,#23,#0a,#92,#23,#0a,#23,#0a
	db #23,#0a,#23,#0a,#23,#0a,#23,#0a
	db #23,#0a,#23,#0a,#94,#22,#0a,#22
	db #0a,#22,#0a,#22,#0a,#22,#0a,#22
.l3b6f equ $ + 7
	db #0a,#22,#0a,#22,#0a,#90,#ff,#ff
.l3b70
	db l3832,l3845,l384d,l3859
	db l388a,l38bc,l38ee,l38f8
	db l391c,l3940,l394e,l398f
	db l39ad,l39e9,l3a2e,l3a70
	db l3a9a,l3ac0,l3b02,l3b39
	db l3b6f
	;db #32,#45,#4d,#59,#8a,#bc,#ee,#f8
	;db #1c,#40,#4e,#8f,#ad,#e9,#2e,#70
	;db #9a,#c0,#02,#39,#6f
.l3b85
	db l3832/&100,l3845/&100,l384d/&100,l3859/&100
	db l388a/&100,l38bc/&100,l38ee/&100,l38f8/&100
	db l391c/&100,l3940/&100,l394e/&100,l398f/&100
	db l39ad/&100,l39e9/&100,l3a2e/&100,l3a70/&100
	db l3a9a/&100,l3ac0/&100,l3b02/&100,l3b39/&100
	db l3b6f/&100
	;db #38,#38,#38,#38,#38,#38,#38,#38
	;db #39,#39,#39,#39,#39,#39,#3a,#3a
	;db #3a,#3a,#3b,#3b,#3b
.l3b9a
	dw l3ba0,l3bc0,l3bea
.l3ba0
	db #fe,#fc,#84,#00,#03,#00,#00,#03
	db #00,#00,#0a,#03,#00,#00,#03,#00
	db #00,#0a,#0d,#0a,#0d,#03,#00,#00
	db #03,#00,#00,#0a,#03,#00,#00,#ff
.l3bc0
	db #fe,#fc,#84,#01,#04,#01,#01,#05
	db #01,#06,#0b,#04,#01,#01,#05,#01
	db #06,#0b,#0e,#0f,#0e,#fe,#f0,#07
	db #fe,#fc,#01,#01,#fe,#f0,#08,#01
	db #06,#fe,#fc,#0b,#fe,#f0,#07,#01
.l3bea equ $ + 2
	db #01,#ff,#fe,#fc,#84,#02,#07,#02
	db #02,#08,#02,#09,#0c,#07,#02,#02
	db #08,#02,#09,#0c,#10,#11,#10,#12
	db #02,#02,#13,#02,#09,#0c,#12,#02
.l3c0a equ $ + 2
	db #02,#ff,#7f,#fe,#01,#ff,#7f,#00
	db #04,#04,#00,#01,#7f,#fd,#01,#ff
	db #7f,#00,#00,#3c,#00,#03,#7f,#ff
	db #5a,#ff,#7f,#00,#04,#01,#00,#01
	db #7f,#fa,#50,#ff,#7f,#00,#03,#01
	db #00,#01,#8a,#19,#39,#00,#00,#00
	db #00,#00,#8a,#29,#41,#00,#00,#00
	db #00,#00,#8a,#21,#39,#00,#00,#00
	db #00,#00,#8a,#19,#41,#00,#00,#00
.l3c52 equ $ + 2
	db #00,#00,#0e,#fe,#01,#ff,#7f,#00
	db #04,#11,#00,#01,#53,#00,#28,#7f
	db #fc,#01,#ff,#7f,#00,#00,#1b,#00
	db #03,#07,#00,#14,#7f,#f5,#01,#ff
	db #7f,#00,#00,#5c,#00,#03,#96,#01
	db #0a,#7f,#fe,#01,#ff,#7f,#05,#04
	db #02,#00,#01,#68,#00,#28
	jp l3d14	; #c3,#14,#3d
	jp l3d9c	; #c3,#9c,#3d
.music_end
.l3c8c
	db #00
	jp l3c97
;
.stop_music
;
	xor a
	ld (l3c8c),a
	jp l4070
.l3c97
	ld l,a
	ld e,a
	ld h,#00
	ld d,h
	add hl,hl
	add hl,de
	add hl,hl
	add hl,hl
	add hl,de
	ld iy,l3c52
	ex de,hl
	add iy,de
	ld l,(iy+#0a)
	ld h,(iy+#0b)
	ld c,(iy+#0c)
	ld ix,l3fb6
	call l3fec
	set 7,(ix+#11)
	ret
.l3cc4 equ $ + 7
.l3cbe equ $ + 1
.l3cbd
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3ccc equ $ + 7
.l3cca equ $ + 5
.l3cc9 equ $ + 4
.l3cc8 equ $ + 3
.l3cc7 equ $ + 2
.l3cc6 equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3cd3 equ $ + 6
.l3cd2 equ $ + 5
	db #00,#00,#00,#00,#00,#08,#00,#00
.l3cdc equ $ + 7
.l3cdb equ $ + 6
.l3cd9 equ $ + 4
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3ce1 equ $ + 4
.l3cdf equ $ + 2
.l3cde equ $ + 1
.l3cdd
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3ce8 equ $ + 3
.l3ce7 equ $ + 2
	db #00,#00,#10,#00,#00,#00,#00,#00
.l3cf4 equ $ + 7
.l3cf3 equ $ + 6
.l3cf2 equ $ + 5
.l3cf1 equ $ + 4
.l3cf0 equ $ + 3
.l3cee equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3cfc equ $ + 7
.l3cf6 equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00
;
.init_music
.l3d14
;
	push af
	call l4070
	pop af
	ld l,a
	add a
	add l
	add a
	ld hl,l3b9a
	add l
	ld l,a
	jr nc,l3d25
	inc h
.l3d25
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l3cbe),de
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l3cd3),de
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l3ce8),de
	xor a
	ld (l3cc7),a
	ld (l3cdc),a
	ld (l3cf1),a
	ld (l3ccc),a
	ld (l3ce1),a
	ld (l3cf6),a
	cpl
	ld (l3cc8),a
	ld (l3cdd),a
	ld (l3cf2),a
	ld a,#01
	ld (l3cc6),a
	ld (l3cdb),a
	ld (l3cf0),a
	ld (l3cc9),a
	ld (l3cde),a
	ld (l3cf3),a
	ld hl,l3cfc
	ld bc,#030a
.l3d74
	xor a
.l3d75
	ld (hl),a
	inc hl
	add c
	ld (hl),a
	inc hl
	add c
	cp #50
	jr nz,l3d75
	djnz l3d74
	ld hl,l3c0a
	ld (l3cc4),hl
	ld (l3cd9),hl
	ld (l3cee),hl
	ld a,#ff
	ld (l3cca),a
	ld (l3cdf),a
	ld (l3cf4),a
	ld (l3c8c),a
	ret
;
.play_music
.l3d9c
;
	call l40ac
	ld a,(l3c8c)
	and a
	ret z
	ld a,(l3cca)
	ld hl,l3cdf
	or (hl)
	ld hl,l3cf4
	or (hl)
	ld (l3c8c),a
	jr nz,l3dc6
	xor a
	ld (l3c8c),a
	ld a,(l3fb5)
	and #3f
	cp #3f
	ret z
	ld a,#01
	ld (l3c8c),a
	ret
.l3dc6
	ld iy,l3cbd
	ld ix,l3fb6
	call l3de4
	ld iy,l3cd2
	ld ix,l3fc8
	call l3de4
	ld iy,l3ce7
	ld ix,l3fda
.l3de4
	call l3f25
	ld a,(iy+#0b)
	and a
	jr z,l3e69
.l3ded
	dec (iy+#09)
	jr z,l3e04
	ld a,(iy+#03)
	ld (iy+#05),a
	ld a,(iy+#04)
	ld (iy+#06),a
	ld (iy+#0b),#00
	jr l3e69
.l3e04
	ld (iy+#09),#01
	ld l,(iy+#01)
	ld h,(iy+#02)
.l3e0e
	ld a,(hl)
	cp #80
	jr c,l3e49
	cp #fe
	jr nz,l3e20
	inc hl
	ld a,(hl)
	ld (iy+#0a),a
	inc hl
	jp l3e0e
.l3e20
	cp #ff
	jr nz,l3e29
	xor a
	ld (iy+#0d),a
	ret
.l3e29
	cp #c0
	jr nc,l3e36
	and #1f
	ld (iy+#09),a
	inc hl
	jp l3e0e
.l3e36
	and #07
	add (iy+#00)
	ld de,l3cfc
	add e
	ld e,a
	jr nc,l3e43
	inc d
.l3e43
	inc hl
	ldi
	jp l3e0e
.l3e49
	ld (iy+#0b),#00
	inc hl
	ld (iy+#01),l
	ld (iy+#02),h
	ld c,a
	ld b,#00
	ld hl,l3b70
	add hl,bc
	ld e,(hl)
	ld hl,l3b85
	add hl,bc
	ld d,(hl)
	ld (iy+#03),e
	ld (iy+#04),d
	jr l3e6f
.l3e69
	ld e,(iy+#05)
	ld d,(iy+#06)
.l3e6f
	dec (iy+#0c)
	jr z,l3e81
	ld a,(de)
	cp #80
	call nc,l3eeb
	ld (iy+#05),e
	ld (iy+#06),d
	ret
.l3e81
	ld a,(de)
	cp #80
	jr c,l3e92
	call l3eeb
	ld a,(iy+#0b)
	and a
	jr z,l3e81
	jp l3ded
.l3e92
	cp #7f
	jr z,l3ede
	cp #7e
	jr nz,l3ea3
	inc de
	ld a,(de)
	ld l,a
	inc de
	ld a,(de)
	ld h,a
	jp l3eb7
.l3ea3
	add (iy+#0a)
	add #0c
	ld (iy+#0e),a
	ld hl,l3788
	add a
	ld c,a
	ld b,#00
	add hl,bc
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
.l3eb7
	ld a,(iy+#0f)
	or #c0
	ld (iy+#14),a
	inc de
	ld a,(de)
	inc de
	ld (iy+#0c),a
	ld c,a
	ld (iy+#05),e
	ld (iy+#06),d
	ld e,(iy+#07)
	ld a,(iy+#08)
	ld hy,a
	ld ly,e
	bit 7,(ix+#11)
	ret nz
	jp l3fec
.l3ede
	inc de
	ld a,(de)
	inc de
	ld (iy+#0c),a
	ld (iy+#05),e
	ld (iy+#06),d
	ret
.l3eeb
	ld a,(de)
	cp #88
	jr nc,l3f09
	and #07
	add (iy+#00)
	ld c,a
	ld b,#00
	ld hl,l3cfc
	add hl,bc
	ld c,(hl)
	ld hl,l3c0a
	add hl,bc
	ld (iy+#07),l
	ld (iy+#08),h
	inc de
	ret
.l3f09
	cp #ff
	jr nz,l3f12
	ld (iy+#0b),#ff
	ret
.l3f12
	cp #c0
	jr nc,l3f1d
	and #0f
	ld (iy+#0f),a
	inc de
	ret
.l3f1d
	inc de
	cp #c2
	ret z
	inc de
	inc de
	inc de
	ret
.l3f25
	bit 7,(ix+#11)
	ret nz
	ld a,(iy+#14)
	bit 7,a
	ret z
	and #3f
	jr nz,l3f39
	res 7,(iy+#14)
	ret
.l3f39
	ld d,#07
	bit 6,(iy+#14)
	jr nz,l3f6d
	dec (iy+#12)
	ret nz
	dec (iy+#13)
	jp z,l3f6d
	ld l,(iy+#10)
	ld h,(iy+#11)
	inc l
	ld (iy+#10),l
	jp nz,l3f5c
	inc h
	ld (iy+#11),h
.l3f5c
	ld a,(hl)
	and d
	ld (iy+#12),a
	ld a,(hl)
	rrca
	rrca
	rrca
	and #1f
	add (iy+#0e)
	jp l3fa2
.l3f6d
	ld hl,#352a
	ld a,(iy+#14)
	add a
	add a
	add a
	ld e,a
	add hl,de
	bit 7,(hl)
	jr nz,l3f87
	bit 6,(iy+#14)
	jr nz,l3f87
	ld (iy+#13),#01
	ret
.l3f87
	res 6,(iy+#14)
	ld a,(hl)
	rrca
	rrca
	rrca
	and d
	ld (iy+#12),a
	ld a,(hl)
	and d
	inc a
	ld (iy+#13),a
	ld (iy+#10),l
	ld (iy+#11),h
	ld a,(iy+#0e)
.l3fa2
	add a
	ld hl,l3788
	add l
	ld l,a
	jr nc,l3fab
	inc h
.l3fab
	ld a,(hl)
	ld (ix+#03),a
	inc hl
	ld a,(hl)
	ld (ix+#04),a
	ret
.l3fbb equ $ + 6
.l3fba equ $ + 5
.l3fb9 equ $ + 4
.l3fb6 equ $ + 1
.l3fb5
	db #bf,#fe,#f7,#09,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3fcc equ $ + 7
.l3fcb equ $ + 6
.l3fc8 equ $ + 3
.l3fc7 equ $ + 2
	db #00,#00,#00,#fd,#ef,#12,#00,#00
.l3fcd
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3fda equ $ + 5
.l3fd9 equ $ + 4
	db #00,#00,#00,#00,#00,#fb,#df,#24
.l3fdf equ $ + 2
.l3fde equ $ + 1
.l3fdd
	db #00,#00,#00,#00,#00,#00,#00,#00
.l3feb equ $ + 6
	db #00,#00,#00,#00,#00,#00,#00
.l3fec
	ld a,ly
	ld (ix+#0f),a
	ld a,hy
	ld (ix+#10),a
	ld (ix+#03),l
	ld (ix+#04),h
	ld (ix+#06),c
	ld a,(iy+#05)
	ld (ix+#07),a
	ld a,(iy+#06)
	and #7f
	srl a
	jr nz,l4010
	ld a,#01
.l4010
	ld (ix+#08),a
	ld a,(iy+#07)
	ld (ix+#0b),a
	ld a,(iy+#08)
	ld (ix+#0c),a
	xor a
	ld (ix+#09),a
	ld (ix+#0a),a
	ld a,(l3fb5)
	or (ix+#02)
	ld c,(iy+#09)
	ld (ix+#11),c
	bit 0,c
	jr z,l4039
	and (ix+#00)
.l4039
	bit 1,c
	jr z,l4040
	and (ix+#01)
.l4040
	ld (l3fb5),a
	bit 2,c
	jr nz,l4051
	ld hl,l41a1
	ld (ix+#0d),l
	ld (ix+#0e),h
	ret
.l4051
	ld hl,#ffbf
	ld c,#fd
	ld a,(iy+#00)
	ld e,#0d
	call l4259
	ld a,(iy+#04)
	ld e,#0b
	call l4259
	inc e
	xor a
	call l4259
	ld (ix+#05),#ff
	ret
.l4070
	ld c,#fd
	ld hl,#ffbf
	ld e,#07
	ld a,(l3fb5)
	or #3f
	ld (l3fb5),a
	call l4259
	xor a
	inc e
	call l4259
	inc e
	call l4259
	inc e
	call l4259
	ld a,#01
	inc e
	call l4259
	inc e
	xor a
	call l4259
	inc e
	call l4259
	ld (l3fc7),a
	ld (l3fd9),a
	ld (l3feb),a
	ld e,#0e
	jp l4259
.l40ac
	ld a,(l3fb5)
	and #3f
	cp #3f
	ret z
	ld ix,l3fb6
	call l416f
	ld ix,l3fc8
	call l416f
	ld ix,l3fda
	call l416f
	ld ix,l3fb6
	ld hl,#ffbf
	ld c,#fd
	ld e,#07
	ld a,(l3fb5)
	call l4259
	ld e,#00
	ld a,(l3fb9)
	add (ix+#09)
	bit 1,(ix+#11)
	jp z,l40ea
	ld d,a
.l40ea
	call l4259
	inc e
	ld a,(l3fba)
	adc (ix+#0a)
	call l4259
	inc e
	ld a,(l3fcb)
	add (ix+#1b)
	bit 1,(ix+#23)
	jp z,l4106
	ld d,a
.l4106
	call l4259
	inc e
	ld a,(l3fcc)
	adc (ix+#1c)
	call l4259
	inc e
	ld a,(l3fdd)
	add (ix+#2d)
	bit 1,(ix+#35)
	jp z,l4122
	ld d,a
.l4122
	call l4259
	inc e
	ld a,(l3fde)
	adc (ix+#2e)
	call l4259
	inc e
	ld a,d
	rrca
	rrca
	rrca
	call l4259
	ld e,#08
	ld a,#7f
	ld d,a
	ld a,(l3fbb)
	cp d
	jr c,l4143
	ld a,d
.l4143
	srl a
	srl a
	srl a
	call l4259
	inc e
	ld a,(l3fcd)
	cp d
	jr c,l4154
	ld a,d
.l4154
	srl a
	srl a
	srl a
	call l4259
	inc e
	ld a,(l3fdf)
	cp d
	jr c,l4165
	ld a,d
.l4165
	srl a
	srl a
	srl a
	jp l4259
	nop
.l416f
	ld a,(l3fb5)
	and (ix+#02)
	cp (ix+#02)
	ret z
	ld a,(ix+#0f)
	ld ly,a
	ld a,(ix+#10)
	ld hy,a
	ld a,(ix+#06)
	and a
	jr z,l4190
	cp #ff
	jr z,l4190
	dec (ix+#06)
.l4190
	call l4217
	bit 2,(iy+#09)
	jp nz,l4210
	ld l,(ix+#0d)
	ld h,(ix+#0e)
	jp (hl)
.l41a1
	ld a,(ix+#05)
	add (iy+#00)
	cp (iy+#04)
	jr nc,l41b0
	ld (ix+#05),a
	ret
.l41b0
	ld a,(iy+#04)
	ld (ix+#05),a
	ld hl,l41c0
	ld (ix+#0d),l
	ld (ix+#0e),h
	ret
.l41c0
	ld a,(ix+#05)
	add (iy+#01)
	jp m,l41d2
	cp (iy+#02)
	jr c,l41d2
	ld (ix+#05),a
	ret
.l41d2
	ld a,(iy+#02)
	ld (ix+#05),a
	ld hl,l41e2
	ld (ix+#0d),l
	ld (ix+#0e),h
	ret
.l41e2
	ld a,(ix+#06)
	and a
	ret nz
	ld hl,l41f1
	ld (ix+#0d),l
	ld (ix+#0e),h
	ret
.l41f1
	ld a,(ix+#05)
	add (iy+#03)
	jp m,l41fe
	ld (ix+#05),a
	ret
.l41fe
	ld (ix+#05),#00
	ld a,(l3fb5)
	or (ix+#02)
	ld (l3fb5),a
	res 7,(ix+#11)
	ret
.l4210
	ld a,(ix+#06)
	and a
	ret nz
	jr l41fe
.l4217
	ld a,(ix+#07)
	and a
	jr z,l4224
	cp #ff
	ret z
	dec (ix+#07)
	ret nz
.l4224
	ld l,(ix+#09)
	ld h,(ix+#0a)
	ld c,(ix+#0b)
	ld b,(ix+#0c)
	add hl,bc
	ld (ix+#09),l
	ld (ix+#0a),h
	dec (ix+#08)
	ret nz
	ld a,(iy+#06)
	and a
	ret z
	jp p,l4248
	ld (ix+#07),#ff
	ret
.l4248
	ld (ix+#08),a
	ld a,c
	cpl
	ld c,a
	ld a,b
	cpl
	ld b,a
	inc bc
	ld (ix+#0b),c
	ld (ix+#0c),b
	ret
.l4259
	ld b,#f4
	out (c),e
	ld hl,#c000
	ld c,#80
	ld b,#f6
	out (c),h
	out (c),l
	ld b,#f4
	out (c),a
	ld b,#f6
	out (c),c
	out (c),l
	ret
	push af
	push bc
	ld bc,#7f10
	out (c),c
	ld a,#4b
	out (c),a
	ld a,#54
	out (c),a
	pop bc
	pop af
	ret

.game_name
	db "Munsters",0
.game_year
	db "1989",0
.game_publisher
	db "Tiger Developments",0
.music_author
	db "Ben Daglish",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
